
clear all 
set maxvar 10000

#delimit ;
global XVar0_PCI "male   
			  age_over80 age_75_80 age_70_75 age_65_70 age_60_65 age_55_60 age_50_55 age_50_less race_1 race_2  
			    out_sta_visitor  hipertensao_prim diabetes_c diabetes_semc chronic_isquem kidney hiv obesidade 
			  ";


global XF "hat_doctor_male hat_gender_missing   

				hat_num_patients12 hat_hora_total hat_ambu_care hat_hosp_care hat_num_cities hat_fee_service hat_emp hat_pub_emp hat_ubs_aff hat_hosp_aff 
				hat_adm_duty
				
				 ";

global PHY_CHAR "share_age share_male share_shared_exp24 share_shared_exp12 share_num_patients12 share_gender_missing share_tot_hor share_ubs_aff 
share_p_sus_aff_hosp share_p_sus_hosp 
share_ambu_care share_hosp_care share_other_care share_sus_care share_mult_cities share_fee_service 
share_emp share_pub_emp share_pub_emp_hosp share_hosp_aff share_num_cities share_adm_duty" ;

global INPUTS "lstay bio_exames hem_exames other_lab radio_exams ekg "; 

global SPENDING "val_tot lnval_tot";

global Xvar "male idade age_over80 age_75_80 age_70_75 age_65_70 age_60_65 age_55_60 age_50_55 age_50_less  
			  race_1 race_2 race_other   race_6  
			   out_sta_visitor  past_read hipertensao_prim   diabetes_c diabetes_semc chronic_isquem kidney hiv obesidade ";
			  
global XVar0 "male   
			  age_over80 age_75_80 age_70_75 age_65_70 age_60_65 age_55_60 age_50_55 age_50_less race_1 race_2 race_other  race_6
			    out_sta_visitor past_read hipertensao_prim  hipertensao_sec  diabetes_c diabetes_semc chronic_isquem kidney hiv obesidade 
			  ";		

global Xvar_phy "share_male share_gender_missing share_num_patients12 
				 share_tot_hor share_ambu_care share_hosp_care 
					share_num_cities share_fee_service share_emp share_pub_emp share_ubs_aff share_hosp_aff   share_adm_duty team_size";
					
global Xvar0_phy " n_team* share_male share_gender_missing share_num_patients12 
				 share_tot_hor share_ambu_care share_hosp_care 
					share_num_cities share_fee_service share_emp share_pub_emp share_ubs_aff share_hosp_aff   share_adm_duty";					
			
#delimit cr


foreach l in 0 1 2 3 4 5 6 7 8 9 10 11 {
globa XVar0_res`l' ""
foreach i in $XVar0 {
globa XVar0_res`l' "${XVar0_res`l'} res`l'_`i'"
}

global Xvar_phy_res`l'
foreach i in $Xvar_phy {
globa Xvar_phy_res`l' "${Xvar_phy_res`l'} res`l'_`i'"
}

global Xvar0_phy_res`l'
foreach i in $Xvar0_phy {
globa Xvar0_phy_res`l' "${Xvar0_phy_res`l'} res`l'_`i'"
}

globa INPUTS_res`l' ""
foreach i in $INPUTS {
globa INPUTS_res`l' "${INPUTS_res`l'} res`l'_`i'"
}

globa SPENDING_res`l' ""
foreach i in $SPENDING {
globa SPENDING_res`l' "${SPENDING_res`l'} res`l'_`i'"
}
}
